package types

import "encoding/xml"

type TplProjectPom struct {
	XMLName      xml.Name `xml:"project"`
	ModelVersion string   `xml:"modelVersion"`
	GroupID      string   `xml:"groupId"`
	ArtifactID   string   `xml:"artifactId"`
	Version      string   `xml:"version"`
	Name         string   `xml:"name"`
	URL          string   `xml:"url"`
	Description  string   `xml:"description"`

	Profiles             Profiles             `xml:"profiles"`
	Properties           Properties           `xml:"properties"`
	DependencyManagement DependencyManagement `xml:"dependencyManagement"`
	Modules              Modules              `xml:"modules"`
	Packaging            string               `xml:"packaging"`
}

type Profiles struct {
	Profile []Profile `xml:"profile"`
}

type Profile struct {
	ID         string            `xml:"id"`
	Activation Activation        `xml:"activation"`
	Properties ProfileProperties `xml:"properties"`
}

type Activation struct {
	ActiveByDefault bool `xml:"activeByDefault"`
}

type ProfileProperties struct {
	XMLName          xml.Name `xml:"properties"`
	Env              string   `xml:"env"`
	DatabaseURL      string   `xml:"database-url"`
	DatabaseUsername string   `xml:"database-username"`
	DatabasePassword string   `xml:"database-password"`
	RedisHost        string   `xml:"redis-host"`
	RedisPort        string   `xml:"redis-port"`
	RedisPassword    string   `xml:"redis-password"`
}

type Properties struct {
	ProfilePath                    string `xml:"profile-path"`
	TokenSecret                    string `xml:"token-secret"`
	RuovVersion                    string `xml:"ruov.version"`
	ProjectBuildSourceEncoding     string `xml:"project.build.sourceEncoding"`
	ProjectReportingOutputEncoding string `xml:"project.reporting.outputEncoding"`
	JavaVersion                    string `xml:"java.version"`
	MavenJarPluginVersion          string `xml:"maven-jar-plugin.version"`
	DruidVersion                   string `xml:"druid.version"`
	BitwalkerVersion               string `xml:"bitwalker.version"`
	SwaggerVersion                 string `xml:"swagger.version"`
	KaptchaVersion                 string `xml:"kaptcha.version"`
	PagehelperBootVersion          string `xml:"pagehelper.boot.version"`
	FastjsonVersion                string `xml:"fastjson.version"`
	OshiVersion                    string `xml:"oshi.version"`
	CommonsIoVersion               string `xml:"commons.io.version"`
	PoiVersion                     string `xml:"poi.version"`
	VelocityVersion                string `xml:"velocity.version"`
	JwtVersion                     string `xml:"jwt.version"`
	MpVersion                      string `xml:"mp.version"`
	MybatisDynamicVersion          string `xml:"mybaits-dynamic.version"`
	HutoolVersion                  string `xml:"hutool.version"`
}

type DependencyManagement struct {
	Dependencies Dependencies `xml:"dependencies"`
}

type Dependencies struct {
	Dependency []Dependency `xml:"dependency"`
}

type Dependency struct {
	GroupID    string `xml:"groupId"`
	ArtifactID string `xml:"artifactId"`
	Version    string `xml:"version"`
	Type       string `xml:"type,omitempty"`
	Scope      string `xml:"scope,omitempty"`
}

type Modules struct {
	Module []string `xml:"module"`
}

type TplLoginPom struct {
	XMLName      xml.Name        `xml:"project"`
	ModelVersion string          `xml:"modelVersion"`
	Parent       Parent          `xml:"parent"`
	Packaging    string          `xml:"packaging"`
	Modules      Modules         `xml:"modules"`
	ArtifactID   string          `xml:"artifactId"`
	Properties   LoginProperties `xml:"properties"`
}

type Parent struct {
	GroupID    string `xml:"groupId"`
	ArtifactID string `xml:"artifactId"`
	Version    string `xml:"version"`
}

type LoginProperties struct {
	JavaVersion                string `xml:"java.version"`
	MavenCompilerSource        string `xml:"maven.compiler.source"`
	MavenCompilerTarget        string `xml:"maven.compiler.target"`
	ProjectBuildSourceEncoding string `xml:"project.build.sourceEncoding"`
}
